<?php
defined('BY_JYA') or exit('error');
list($id,$content,$nowait,$print_nums,$tpl_type)=$arguments;
$setting=$this->plugin_setting('setting');
if(!$setting || !$setting['user'] || !$setting['ukey']){
	return error('接口参数错误！联系管理员设置！');
}
$print=pdo_get('jy_feieyun_print',array('id'=>$id));
$seri_num=$print['sn'];
if(!$seri_num){
	return error('指定打印机不存在！');
}
if($print_nums>1 && $print_nums<=10){
	for($i=0;$i<$print_nums;$i++){
		$nums = $i+1;
		$times_str = "<C>《第".$nums."联》</C><BR>";
		$times_str .= "<C>-----------------------</C><BR>";
		$pscontent = $times_str . $content;
		$result=$this->model('jinyunzn',$setting)->printing($seri_num,$pscontent,$print['type'],$nowait,$tpl_type);
	}
}else{
	$result=$this->model('jinyunzn',$setting)->printing($seri_num,$content,$print['type'],$nowait,$tpl_type);
}
if(is_array($result) && $result['ret']==0){
	return true;
}else{
	return error($result['msg']);
}
